package main

import (
	"flag"
	"github.com/kataras/iris/v12"
	"irisdemo/config"
	"irisdemo/db"
	"irisdemo/routes"
	"os"
)

func main() {
	flag.Parse()

	config.InitConfig()
	db.InitDB()
	db.InitCache()

	app := iris.Default()

	//设置路由
	routes.InitApiRoute(app)

	//设置日志
	file, _ := os.Create("./tmp/iris.log")
	app.Logger().SetLevel("info").SetOutput(file)

	//app.Favicon("./favicon.ico")
	//app.HandleDir("/assets", "./assets")

	app.Listen(":3000")
}
